/*
 * ProtocolParameter.java
 */

package rehab.host.global;

import com.sun.spot.peripheral.radio.IProprietaryRadio;
import com.sun.spot.peripheral.radio.IRadioPolicyManager;

/**
 *
 * @author mi zhang
 */
public interface ProtocolParameter {

    /**
     * Constants.
     */
    public static final int SECOND = 1000; // In milliseconds

    /**
     * Radio Settings.
     */
    public static final int INITIAL_CHANNEL_NUMBER = IProprietaryRadio.DEFAULT_CHANNEL;
    public static final short PAN_ID               = IRadioPolicyManager.DEFAULT_PAN_ID;
    public int channel = INITIAL_CHANNEL_NUMBER;
    public int power = 32;                             // Start with max transmit power
                                                        // In SunSPOT, the maximum is 0

    /**
     * Protocol Parameters.
     */
    public static final String HEARTBEAT_BROADCAST_PORT     = "100";
    public static final int HEARTBEAT_PERIOD                = 10 * SECOND;
    public static final int TIMEOUT_PERIOD                  = 3 * SECOND;
    public static final int MAX_MISSED_PACKETS              = 5;
    public static final int MAX_SLEEP_TIME                  = 2 * SECOND;
    public static final int DEEP_SLEEP_TIME                 = 5 * HEARTBEAT_PERIOD;
    public static final int SAMPLE_PERIOD                   = 10;  // 10 milliseconds

}
